#pragma once
#include "../widgets.h"
#include <QWidget>
#include <QVBoxLayout>
#include <guiframe/IMainFrame.h>

class QWebEngineView;
class S_WIDGETS_EXPORT SWebWidget
    : public QWidget
{
    Q_OBJECT
public:
    SWebWidget(const QString& title, const QString& url, QWidget* parent = nullptr);
    ~SWebWidget();

    QWebEngineView* view() { return m_webView; }
    void setUrl(const QString& url);

public slots:
	void onReqHandler(int, QString, QString);

protected:
    void initCtrl();

private:
    QString                         m_title;
    QString                         m_url;
    QWebEngineView*                 m_webView = nullptr;
};
